import Vue from 'vue'
import Router from 'vue-router'
// import { mapMutations } from 'vuex'
const HomePage = () => import('components/home-page/home-page')
const GoodGoods = () => import('components/good-goods/good-goods')
const GoodPrice = () => import('components/good-price/good-price')
const UserPage = () => import('components/user-page/user-page')
const GoodDetail = () => import('components/goods-detail/goods-detail')
const SearchResultDisplay = () => import('components/search-result-display/search-result-display')
const FenleiMenu = () => import('components/fenlei-menu/fenlei-menu')
const FenLeiDetailPage = () => import('components/fenlei-detail-page/fenlei-detail-page')
const LogoPage = () => import('components/logo-page/logo-page')
const Animation01 = () => import('components/animation01/animation01')
const FormTest = () => import('components/form-test/form-test')
// const UserCenter = () => import(/* webpackChunkName: "group-app" */ '@/components/user-center/user-center')

Vue.use(Router)

let mRouter = new Router({
  routes: [
    {
      path: '/',
      name: 'root',
      component: LogoPage
    },
    {
      path: '/homepage',
      name: 'homePage',
      component: HomePage
    },
    {
      path: '/goodsdetail/:id',
      name: 'goodsDetail',
      component: GoodDetail
    },
    {
      path: '/goodprice',
      name: 'goodPrice',
      component: GoodPrice
    },
    {
      path: '/goodgoods',
      name: 'goodGoods',
      component: GoodGoods
    },
    {
      path: '/userpage',
      name: 'userPage',
      component: UserPage
    },
    {
      path: '/searchresultdisplay',
      name: 'searchResultDisplay',
      component: SearchResultDisplay
    },
    {
      path: '/fenleimenu',
      name: 'fenleiMenu',
      component: FenleiMenu
    },
    {
      path: '/fenleidetailpage',
      name: 'fenleiDetailPage',
      component: FenLeiDetailPage
    },
    {
      path: '/animation01',
      name: 'animation01',
      component: Animation01
    },
    {
      path: '/formtest',
      name: 'formtest',
      component: FormTest
    }
  ]
})

// mRouter.afterEach((to, from) => {
//   console.log('afterEach:')
//   console.log(to)
//   if (to.name === 'homePage') {
//   }
// })

export default mRouter
